home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 43
/
Aminet 43 (2001)(GTI - Schatztruhe)[!][Jun 2001].iso
/
Aminet
/
comm
/
tcp
/
rxsocket.lha
/
rxsocket
/
examples
/
dsc.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
2001-03-01
|
889b
|
32 lines
/*
client for the ds service, see ds.rexx
*/
l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then call err "rmh.library not found",1
if AddLibrary("rexxsupport.library","rxsocket.library")~=0 then call err result "not found",1
sin.addrport = 10000
sin.addraddr = "127.0.0.1"
sock = socket("INET","STREAM")
if sock<0 then call err "can't create socket"
if connect(sock,"SIN")<0 then call err "can't connect"
request = "A"
if send(sock,request)~=1 then call err "send error"
res=recv(sock,"BUF",256)
if res<0 then call err "recv error"
if res=0 then call err "connection closed",1
else say buf
exit
/***************************************************************************/
err: procedure expose prg
parse arg msg,ntdoerr
if ntdoerr~=1 then msg = msg "("ErrorString(errno())")"
say msg
exit
/***************************************************************************/